import { Ruler } from 'leafer-x-ruler'
export class Rule {
    static name = 'ruler'
    constructor(app, options) {
        this.app = app
        this.ruler = null
        this.options = options
    }
    init() {
        if (!this.options.ruler) return
        // 尺子
        this.ruler = new Ruler(this.app);
        this.ruler.addTheme('custom1', {
            backgroundColor: '#FFF',
            textColor: '#a45454',
            borderColor: '#6f4593',
            highlightColor: 'rgba(113, 159, 245, 1)'
        })
        this.ruler.changeTheme('custom1')
        // 启用、禁用  
        this.ruler.enabled = true
        return this
    }
    Cancel() {
        if (this.ruler) return this.ruler.enabled = false
    }

}